app.controller("automaticProcessingBillsCtrl", function ($scope,$interval, $http, automaticProcessingBillsService) {

    //----------分页参数------------
    $scope.pageRowSize = 10;
    $scope.curPage = 1;

    //-----------------------------

    $scope.object = {};
    $scope.formMode = false;
    $scope.errors = {};

    //--------------初始化菜单---------------
    $scope.initMenu = function () {
        showSecondMenu('billingManage');
        selectSecondMenu('automaticProcessingBills');
    }
    $scope.initMenu();

    //---------------错误信息--------------
    $scope.requestError = function () {
        $scope.errorMessage = "unknown error!"
    };

    $scope.init = function () {

    };

    //设置生成账单时间
    $scope.setAutomaticProcessingBillsTime = function () {
        var automaticProcessingBillsTime = $("#timeSel").val();
        if(NullOrUndefined(automaticProcessingBillsTime)){
            promptMsg("请选择生成账单时间！");
            return false;
        }

        automaticProcessingBillsService.setAutomaticProcessingBillsTime({
            action : 'setAutomaticProcessingBillsTime',
            configValue :  automaticProcessingBillsTime
        }, function (data) {
            if (data.status == "SUCCESS") { //编辑成功
                promptMsg(data.data.msg);
            }else {
                promptMsg(data.errorReason);
            }
        }, $scope.requestError());
    }
});